﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="SimplePMT.Login" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <link rel="stylesheet" type="text/css" href="css/SimplePMT.css" />
    <title>SimplePMT Login</title>
</head>
<body>
    <form id="ajaxForm" runat="server"></form>
    
    <form name="loginForm" action="Login.aspx" method="post">
    &nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />
    <table bgcolor="#98AECB" align=center cellpadding=1 cellspacing=0 border=0 style="width:45%">
	<tr bgcolor="#CCD7E5">
		<td align=left valign=top height=19 bgcolor="#98AECB">&nbsp; LOG IN</td>
	</tr>
	<tr>
        <td bgcolor="#98AECB" colspan=2 align=center valign=middle>
            <table style="width:100%;height:100%" bgcolor="#EFF2F6">
		        <tr>
		            <td valign=top><table style="width:100%;height:100%" bgcolor="#EFF2F6">
		        <tr>
		            <td valign=top>
                        <table>
                            <tr>
                                <td align=right>Username:</td>
                                <td><input type="text" size=20 name="username" value="" onKeyPress = "return entersubmit(event)" /></td>
                            </tr>
                            <tr>
                                <td align=right>Password:</td>
                                <td><input type="password" size=20 name="password" value="" onKeyPress = "return entersubmit(event)"/></td>
                            </tr>
                            <tr>
                                <td align=right></td>
                                <td><input type="checkbox" name="storeInCookie" value="1" onKeyPress = "return entersubmit(event)" /> save login &nbsp;&nbsp;<button type="button" onclick="processLogin();">Log In</button></td>
                            </tr>
                        </table>
                    </td>
                 </tr>
              </table>
        </td>
    </tr>
</table>
    </form>
    <script language="javascript">
        function entersubmit(e) {
            var keycode;
            if (window.event) keycode = window.event.keyCode;
            else if (e) keycode = e.which;
            else return true;

            if (keycode == 13) {
                processLogin();
                return false;
            }
        }

    document.loginForm.username.focus();
    function processLogin() {
        var df = document.loginForm;
        var cont = true;
        if (df.username.value == '') {
            alert('You must enter a username to continue.');
            df.username.focus();
            cont = false;
        }
        if (df.password.value == '' && cont) {
            alert('You must enter a password to continue.');
            df.password.focus();
            cont = false
        }
        if (cont) {
            df.submit();
        }
    }
    </script>
</body>
</html>
